package com.androidmvp.dreammvp.simple6;

import com.androidmvp.dreammvp.simple6.base.BasePresenter_6;
import com.androidmvp.local.table.WeatherInfo;

import java.util.List;

/**
 * Presenter 主要起连接 View 和 Dao 的作用
 */
public class MainPresenter_6 extends BasePresenter_6<MainView_6> {


    public WeatherDao_6 weatherDao =new WeatherDao_6(this);

    public MainPresenter_6() {
        this.weatherDao= new WeatherDao_6(this);
    }
    public void getData(){
        if (getView() != null){
            getView().showProgressBar();
            weatherDao.getData();
        }
    }

    public void loadDataSuccess(List<WeatherInfo> list) {
        getView().showData(list.get(0));
    }
    public void loadDataFailure(){
        getView().showData(null);
    }
}
